package com.lancoo.answer.util.paperUtils.fragmentUtils.ques;

import androidx.fragment.app.Fragment;

import com.lancoo.answer.model.bean.Ques;
import com.lancoo.answer.ui.ques.NoSpliteLayoutFragment;
import com.lancoo.answer.ui.ques.SpliteLayoutFragment;
import com.lancoo.answer.view.fragment.correctmistake.AnalysisCorrectMistakesFragment;
import com.lancoo.answer.view.fragment.option.OptionLookingFragment;

/**
 * Created by pengmi on 2022/2/20 11:49
 * Description:大题互评状态状态fragment加载
 */
public class QuesMuteValueteFragmentUtils {

    public static Fragment loadQuesMuteValueteFragment(Ques ques,
                                                       int typeIndex,
                                                       int quesIndex,
                                                       int defaultLoadChildIndex,int defaultLoadItemIndex){
        String genreID=ques.getGenreID();
        String typeNo=ques.getTypeNo();
        switch (typeNo) {
            case "A"://单选题
                return NoSpliteLayoutFragment.loadFragment(typeIndex, quesIndex, defaultLoadChildIndex);
            case "S"://听力填空
                return SpliteLayoutFragment.loadFragment(typeIndex, quesIndex, defaultLoadItemIndex,defaultLoadItemIndex);
            case "m"://词汇匹配
                return OptionLookingFragment.Companion.loadFragment(typeIndex, quesIndex, defaultLoadChildIndex, defaultLoadItemIndex);
            case "U"://改错题
                return AnalysisCorrectMistakesFragment.Companion.loadFragment(typeIndex, quesIndex, defaultLoadItemIndex);
        }
        switch (genreID) {
            case "21"://句子填空
            case "38"://句子英译中
            case "40"://句子中译英
            case "25"://英译中
            case "26"://中译
                return NoSpliteLayoutFragment.loadFragment(typeIndex, quesIndex, defaultLoadChildIndex);
            case "45"://多项对应
            default:
                return SpliteLayoutFragment.loadFragment(typeIndex, quesIndex, defaultLoadChildIndex,defaultLoadItemIndex);
        }
    }
}
